home *** CD-ROM | disk | FTP | other *** search
/ Best of www.BestZips.com (Collector's Edition) / Best of WWW.BESTZIPS.COM Collector's Edition (JCSM Shareware) (JCS Marketing).ISO / editors_ / ze16v250.zip / CONFIG.H_ / CONFIG.H
C/C++ Source or Header  |  1992-04-05  |  13KB  |  528 lines

  1. /*
  2.  * vi configuration file
  3.  * We try to automatically configure to various compilers and operating
  4.  * systems. Extend the autoconf section as needed.
  5.  */
  6.  
  7. #ifndef _CONFIG_H
  8. # define _CONFIG_H
  9.  
  10. /*************************** autoconf section ************************/
  11.  
  12. /* Commodore-Amiga */
  13. #ifdef    amiga
  14. # define AMIGA        1
  15. # define COMPILED_BY    "Manx Aztec C 5.2b"
  16. #endif
  17.  
  18. /* standard unix V (?) */
  19. #ifdef    M_SYSV
  20. # define UNIXV        1
  21. #endif
  22.  
  23. /* xelos system, University of Ulm */
  24. #ifdef    xelos
  25. # define UNIXV        1
  26. #endif
  27.  
  28. /* BSD UNIX? */
  29. #ifdef bsd
  30. # define BSD        1
  31. #else
  32. # ifdef sun
  33. #  define BSD        1
  34. # endif
  35. #endif
  36.  
  37. /* Microsoft C: sorry, Watcom does the same thing */
  38. #ifdef    M_I86
  39. # ifndef M_SYSV
  40. #  define MSDOS        1
  41. #  ifdef IBMC2
  42. #   define COMPILED_BY    "IBM C/2 1.00"
  43. #  else
  44. #   define MICROSOFT    1
  45. #   define COMPILED_BY    "Microsoft C 5.10"
  46. #  endif
  47. # endif
  48. #endif
  49.  
  50. /* Borland's Turbo C */
  51. #ifdef    __TURBOC__
  52. # define MSDOS        1
  53. # define TURBOC        1
  54. # ifdef __BORLANDC__
  55. # define COMPILED_BY    "Borland C 2.00"
  56. # else
  57. # define COMPILED_BY    (__TURBOC__ >= 661 ? "Turbo C++ 1.00" : "Turbo C 2.00")
  58. # endif
  59. #endif
  60.  
  61. /* Tos Mark-Williams */
  62. #ifdef    M68000
  63. # define TOS 1
  64. # define COMPILED_BY    "Mark Williams C"
  65. #endif
  66.  
  67. /* Tos GNU-C */
  68. #if defined(__atarist__) && defined(__gem__)
  69. # define TOS 1
  70. # define COMPILED_BY    "GNU-C " __VERSION__
  71. #endif
  72.  
  73. /* OS9/68000 */
  74. #ifdef    OSK
  75. # define COMPILED_BY    "Microware C V2.3 Edition 40"
  76. #endif
  77.  
  78. /* DEC Rainbow, running MS-DOS (handled by earlier MS-DOS tests) */
  79. /* (would need -DRAINBOW in CFLAGS to compile a Rainbow-compatible .EXE) */
  80.  
  81. #ifdef VMS
  82. # define COMPILED_BY    "VAX/VMS VAXC compiler"
  83. # undef VMS
  84. # define VMS 1
  85. #endif
  86.  
  87. /*************************** end of autoconf section ************************/
  88.  
  89. /* All undefined symbols are defined to zero here, to allow for older    */
  90. /* compilers which dont understand #if defined() or #if UNDEFINED_SYMBOL */
  91.  
  92. /*************************** operating systems *****************************/
  93.  
  94. #ifndef    BSD
  95. # define BSD    0        /* UNIX - Berkeley 4.x */
  96. #endif
  97.  
  98. #ifndef    UNIXV
  99. # define UNIXV    0        /* UNIX - AT&T SYSV */
  100. #endif
  101.  
  102. #ifndef    UNIX7
  103. # define UNIX7    0        /* UNIX - version 7 */
  104. #endif
  105.  
  106. #ifndef    MSDOS
  107. # define MSDOS    0        /* PC        */
  108. #endif
  109.  
  110. #ifndef    TOS
  111. # define TOS    0        /* Atari ST    */
  112. #endif
  113.  
  114. #ifndef    AMIGA
  115. # define AMIGA    0        /* Commodore Amiga */
  116. #endif
  117.  
  118. #ifndef OSK
  119. # define OSK    0        /* OS-9 / 68k */
  120. #endif
  121.  
  122. #ifndef COHERENT
  123. # define COHERENT 0        /* Coherent */
  124. #endif
  125.  
  126. #ifndef RAINBOW            /* DEC Rainbow support, under MS-DOS */
  127. # define RAINBOW 0
  128. #endif
  129.  
  130. #ifndef VMS
  131. # define VMS 0                  /* VAX/VMS */
  132. #endif
  133.                 /* Minix has no predefines */
  134. #if !BSD && !UNIXV && !UNIX7 && !MSDOS && !TOS && !AMIGA && !OSK && !COHERENT && !VMS
  135. # define MINIX    1
  136. #else
  137. # define MINIX    0
  138. #endif
  139.  
  140.                 /* generic combination of Unices */
  141. #if UNIXV || UNIX7 || BSD || MINIX || COHERENT
  142. # define ANY_UNIX 1
  143. #else
  144. # define ANY_UNIX 0
  145. #endif
  146.  
  147. /*************************** compilers **************************************/
  148.  
  149. #ifndef    AZTEC_C
  150. # define AZTEC_C    0
  151. #endif
  152.  
  153. #ifndef    MICROSOFT
  154. # define MICROSOFT    0
  155. #endif
  156.  
  157. #ifndef    TURBOC
  158. # define TURBOC        0
  159. #endif
  160.  
  161. /******************************* Credit ************************************/
  162.  
  163. #if MSDOS
  164. # define CREDIT "Ported to MS-DOS by Guntram Blohm & Martin Patzel"
  165. # if RAINBOW
  166. #  define CREDIT2 "Rainbow support added by Willett Kempton"
  167. # endif
  168. #endif
  169.  
  170. #if AMIGA
  171. # define CREDIT "Ported to AmigaDOS 2.04 by Mike Rieser & Dale Rahn"
  172. #endif
  173.  
  174. #if TOS
  175. # define CREDIT "Ported to Atari/TOS by Guntram Blohm & Martin Patzel"
  176. #endif
  177.  
  178. #if OSK
  179. # define CREDIT    "Ported to Microware OS9/68k by Peter Reinig"
  180. #endif
  181.  
  182. #if COHERENT
  183. # define CREDIT    "Ported to Coherent by Esa Ahola"
  184. #endif
  185.  
  186. #if VMS
  187. # define CREDIT "Ported to VAX/VMS by John Campbell"
  188. #endif
  189. /*************************** functions depending on OS *********************/
  190.  
  191. /* There are two terminal-related functions that we need: ttyread() and
  192.  * ttywrite().  The ttyread() function implements read-with-timeout and is
  193.  * a true function on all systems.  The ttywrite() function is almost always
  194.  * just a macro...
  195.  */
  196. #if !TOS && !AMIGA
  197. # define ttywrite(buf, len)    write(1, buf, (unsigned)(len))    /* raw write */
  198. #endif
  199.  
  200. /* The strchr() function is an official standard now, so everybody has it
  201.  * except Unix version 7 (which is old) and BSD Unix (which is academic).
  202.  * Those guys use something called index() to do the same thing.
  203.  */
  204. #if BSD || UNIX7 || OSK
  205. # define strchr    index
  206. #endif
  207. extern char *strchr();
  208.  
  209. /* BSD uses bcopy() instead of memcpy() */
  210. #if BSD
  211. # define memcpy(dest, src, siz)    bcopy(src, dest, siz)
  212. #endif
  213.  
  214. /* BSD uses getwd() instead of getcwd().  The arguments are a little different,
  215.  * but we'll ignore that and hope for the best; adding arguments to the macro
  216.  * would mess up an "extern" declaration of the function.
  217.  */
  218. #if BSD || COHERENT
  219. # define getcwd    getwd
  220. #endif
  221. extern char *getcwd();
  222.  
  223. /* text versa binary mode for read/write */
  224. #if !TOS
  225. #define    tread(fd,buf,n)        read(fd,buf,(unsigned)(n))
  226. #define twrite(fd,buf,n)    write(fd,buf,(unsigned)(n))
  227. #endif
  228.  
  229. /**************************** Compiler quirks *********************************/
  230.  
  231. /* the UNIX version 7 and (some) TOS compilers, don't allow "void" */
  232. #if UNIX7 || TOS
  233. # define void int
  234. #endif
  235.  
  236. /* as far as I know, all compilers except version 7 support unsigned char */
  237. /* NEWFLASH: the Minix-ST compiler has subtle problems with unsigned char */
  238. #if UNIX7 || MINIX
  239. # define UCHAR(c)    ((c) & 0xff)
  240. # define uchar        char
  241. #else
  242. # define UCHAR(c)    ((unsigned char)(c))
  243. # define uchar        unsigned char
  244. #endif
  245.  
  246. /* Some compilers prefer to have malloc declared as returning a (void *) */
  247. #if BSD || AMIGA
  248. extern void *malloc();
  249. #else
  250. extern char *malloc();
  251. #endif
  252.  
  253. /* everybody but Amiga wants lseek declared here */
  254. #if !AMIGA
  255. extern long lseek();
  256. #endif
  257.  
  258. /******************* Names of files and environment vars **********************/
  259.  
  260. #if ANY_UNIX
  261. # ifndef TMPDIR
  262. #  if MINIX
  263. #   define TMPDIR    "/usr/tmp"    /* Keep elvis' temp files off RAM disk! */
  264. #  else
  265. #   define TMPDIR    "/tmp"        /* directory where temp files live */
  266. #  endif
  267. # endif
  268. # ifndef PRSVDIR
  269. #  define PRSVDIR    "/usr/preserve"    /* directory where preserved file live */
  270. # endif
  271. # ifndef PRSVINDEX
  272. #  define PRSVINDEX    "/usr/preserve/Index" /* index of files in PRSVDIR */
  273. # endif
  274. # ifndef EXRC
  275. #  define EXRC        ".exrc"        /* init file in current directory */
  276. # endif
  277. # define SCRATCHOUT    "%s/soXXXXXX"    /* temp file used as input to filter */
  278. # ifndef SHELL
  279. #  define SHELL        "/bin/sh"    /* default shell */
  280. # endif
  281. # if COHERENT
  282. #  ifndef REDIRECT
  283. #   define REDIRECT    ">"        /* Coherent CC writes errors to stdout */
  284. #  endif
  285. # endif
  286. #endif
  287.  
  288. #if AMIGA        /* Specify AMIGA environment */
  289. # ifndef CC_COMMAND
  290. #  define CC_COMMAND    "cc"        /* generic C compiler */
  291. # endif
  292. # ifndef COLON
  293. #  define COLON        ':'        /* Amiga files can also end in `:' */
  294. # endif
  295. # ifndef SYSEXRC
  296. #  define SYSEXRC    "S:" EXRC    /* name of ".exrc" file in system dir */
  297. # endif
  298. # ifndef MAXRCLEN
  299. #  define MAXRCLEN    2048        /* max size of a .exrc file */
  300. # endif
  301. # ifndef NBUFS
  302. #  define NBUFS        10        /* must be at least 3 -- more is better */
  303. # endif
  304. # ifndef NEEDSYNC
  305. #  define NEEDSYNC    TRUE        /* assume ":se sync" by default */
  306. # endif
  307. # ifndef PRSVDIR
  308. #  define PRSVDIR    "Elvis:"    /* directory where preserved file live */
  309. # endif
  310. # ifndef PRSVINDEX
  311. #  define PRSVINDEX    "Elvis:Index"    /* index of files in PRSVDIR */
  312. # endif
  313. # ifndef REDIRECT
  314. #  define REDIRECT    ">"        /* Amiga writes errors to stdout */
  315. # endif
  316. # ifndef SCRATCHIN
  317. #  define SCRATCHIN    "%sSIXXXXXX"
  318. # endif
  319. # ifndef SCRATCHOUT
  320. #  define SCRATCHOUT    "%sSOXXXXXX"
  321. # endif
  322. # ifndef SHELL
  323. #  define SHELL        "newshell"    /* default shell */
  324. # endif
  325. # ifndef TERMTYPE
  326. #  define TERMTYPE    "amiga"        /* default termtype */
  327. # endif
  328. # ifndef TMPDIR                /* for AMIGA should end in `:' or `/' */
  329. #  define TMPDIR    "T:"        /* directory where temp files live */
  330. # endif
  331. # ifndef TMPNAME
  332. #  define TMPNAME    "%selv_%x.%x"    /* format of names for temp files */
  333. # endif
  334. #endif
  335.  
  336. #if MSDOS || TOS
  337. /* do not change TMPNAME and SCRATCH*: they MUST begin with '%s\\'! */
  338. # ifndef TMPDIR
  339. #  define TMPDIR    "C:\\tmp"    /* directory where temp files live */
  340. # endif
  341. # ifndef PRSVDIR
  342. #  define PRSVDIR    "C:\\preserve"    /* directory where preserved file live */
  343. # endif
  344. # ifndef PRSVINDEX
  345. #  define PRSVINDEX    "C:\\preserve\\Index" /* index of files in PRSVDIR */
  346. # endif
  347. # define TMPNAME    "%s\\elv_%x.%x" /* temp file */
  348. # if MSDOS
  349. #  if MICROSOFT
  350. #   define CC_COMMAND    "cl -c"        /* C compiler */
  351. #  else
  352. #   if __BORLANDC__  /* Borland C */
  353. #    define CC_COMMAND    "bcc"        /* C compiler */
  354. #   else
  355. #   if TURBOC        /* Turbo C */
  356. #    define CC_COMMAND    "tcc"        /* C compiler */
  357. #   endif    /* TURBOC */
  358. #   endif    /* BORLANDC */
  359. #  endif        /* MICROSOFT */
  360. # endif        /* MSDOS */
  361. # define SCRATCHIN    "%s\\siXXXXXX"    /* DOS ONLY - output of filter program */
  362. # define SCRATCHOUT    "%s\\soXXXXXX"    /* temp file used as input to filter */
  363. # define SLASH        '\\'
  364. # ifndef SHELL
  365. #  if TOS
  366. #   define SHELL    "shell.ttp"    /* default shell */
  367. #  else
  368. #   define SHELL    "command.com"    /* default shell */
  369. #  endif
  370. # endif
  371. # define NEEDSYNC    TRUE        /* assume ":se sync" by default */
  372. # if TOS && __GNUC__            /* probably on other systems, too */
  373. #  define REDIRECT    "2>"        /* GNUC reports on 2, others on 1 */
  374. #  define CC_COMMAND    "gcc -c"
  375. # else
  376. #  define REDIRECT    ">"        /* shell's redirection of stderr */
  377. # endif
  378. #endif
  379.  
  380. #if VMS
  381. /* do not change TMPNAME, and SCRATCH*: they MUST begin with '%s\\'! */
  382. # ifndef TMPDIR
  383. #  define TMPDIR        "sys$scratch:"  /* directory where temp files live */
  384. # endif
  385. # define TMPNAME        "%selv_%x.%x;1" /* temp file */
  386. # define SCRATCHIN      "%ssiXXXXXX"    /* DOS ONLY - output of filter program */
  387. # define SCRATCHOUT     "%ssoXXXXXX"    /* temp file used as input to filter */
  388. # define SLASH          '\:'  /* Worry point... jdc */
  389. # ifndef SHELL
  390. #   define SHELL        ""      /* default shell */
  391. # endif
  392. # define REDIRECT       ">"             /* shell's redirection of stderr */
  393. # define tread(fd,buf,n)  vms_read(fd,buf,(unsigned)(n))
  394. # define close vms_close
  395. # define lseek vms_lseek
  396. # define unlink vms_delete
  397. # define delete __delete   /* local routine conflicts w/VMS rtl routine. */
  398. # define rpipe vms_rpipe
  399. # define rpclose vms_rpclose
  400. # define ttyread vms_ttyread
  401. /* There is no sync() on vms */
  402. # define sync()
  403. /* jdc -- seems VMS external symbols are case insensitive */
  404. # define m_fWord m_fw_ord
  405. # define m_bWord m_bw_ord
  406. # define m_eWord m_ew_ord
  407. # define m_Nsrch m_n_srch
  408. # define m_Fch   m_f_ch
  409. # define m_Tch   m_t_ch
  410. # define v_Xchar v_x_char
  411. /* jdc -- also, braindead vms curses always found by linker. */
  412. # define LINES elvis_LINES
  413. # define COLS  elvis_COLS
  414. # define curscr elvis_curscr
  415. # define stdscr elvis_stdscr
  416. # define initscr elvis_initscr
  417. # define endwin  elvis_endwin
  418. # define wrefresh elvis_wrefresh
  419. #endif
  420.  
  421. #if OSK
  422. # ifndef TMPDIR
  423. #  define TMPDIR    "/dd/tmp"       /* directory where temp files live */
  424. # endif
  425. # ifndef PRSVDIR
  426. #  define PRSVDIR    "/dd/usr/preserve" /* directory where preserved file live */
  427. # endif
  428. # ifndef PRSVINDEX
  429. #  define PRSVINDEX    "/dd/usr/preserve/Index" /* index of files in PRSVDIR */
  430. # endif
  431. # ifndef CC_COMMAND
  432. #  define CC_COMMAND    "cc -r"           /* name of the compiler */
  433. # endif
  434. # ifndef EXRC
  435. #  define EXRC        ".exrc"           /* init file in current directory */
  436. # endif
  437. # define SCRATCHOUT    "%s/soXXXXXX"       /* temp file used as input to filter */
  438. # ifndef SHELL
  439. #  define SHELL        "shell"           /* default shell */
  440. # endif
  441. # define FILEPERMS    (S_IREAD|S_IWRITE) /* file permissions used for creat() */
  442. # define REDIRECT    ">>-"           /* shell's redirection of stderr */
  443. # define sync()                   /* OS9 doesn't need a sync() */
  444. #endif
  445.  
  446. #ifndef    TAGS
  447. # define TAGS        "tags"        /* name of the tags file */
  448. #endif
  449.  
  450. #ifndef TMPNAME
  451. # define TMPNAME    "%s/elv_%x.%x"    /* format of names for temp files */
  452. #endif
  453.  
  454. #ifndef EXINIT
  455. # define EXINIT        "EXINIT"    /* name of EXINIT environment variable */
  456. #endif
  457.  
  458. #ifndef    EXRC
  459. # define EXRC        "elvis.rc"    /* name of ".exrc" file in current dir */
  460. #endif
  461.  
  462. #ifndef HMEXRC
  463. # define HMEXRC        EXRC        /* name of ".exrc" file in home dir */
  464. #endif
  465.  
  466. #ifndef    KEYWORDPRG
  467. # define KEYWORDPRG    "ref"
  468. #endif
  469.  
  470. #ifndef    SCRATCHOUT
  471. # define SCRATCHIN    "%s/SIXXXXXX"
  472. # define SCRATCHOUT    "%s/SOXXXXXX"
  473. #endif
  474.  
  475. #ifndef ERRLIST
  476. # define ERRLIST    "errlist"
  477. #endif
  478.  
  479. #ifndef    SLASH
  480. # define SLASH        '/'
  481. #endif
  482.  
  483. #ifndef SHELL
  484. # define SHELL        "shell"
  485. #endif
  486.  
  487. #ifndef REG
  488. # define REG        register
  489. #endif
  490.  
  491. #ifndef NEEDSYNC
  492. # define NEEDSYNC    FALSE
  493. #endif
  494.  
  495. #ifndef FILEPERMS
  496. # define FILEPERMS    0666
  497. #endif
  498.  
  499. #ifndef PRESERVE
  500. # define PRESERVE    "elvprsv"    /* name of the "preserve" program */
  501. #endif
  502.  
  503. #ifndef CC_COMMAND
  504. # define CC_COMMAND    "cc -c"
  505. #endif
  506.  
  507. #ifndef MAKE_COMMAND
  508. # define MAKE_COMMAND    "make"
  509. #endif
  510.  
  511. #ifndef REDIRECT
  512. # define REDIRECT    "2>"
  513. #endif
  514.  
  515. #ifndef BLKSIZE
  516. # ifdef CRUNCH
  517. #  define BLKSIZE    1024
  518. # else
  519. #  define BLKSIZE    2048
  520. # endif
  521. #endif
  522.  
  523. #ifndef KEYBUFSIZE
  524. # define KEYBUFSIZE    1000
  525. #endif
  526.  
  527. #endif  /* ndef _CONFIG_H */
  528.